﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CSP.Dao.CommonDao;
using CSP.Dao.IObjectDaos.CSP;
using CSP.DataAccess;
using CSP.Model.CSP;

namespace CSP.Dao.ObjectDaos.CSP
{
    public class ServiceImageDao:CSPCommonDao,IServiceImageDao
    {
        public ServiceImageDao(CSPContext context, bool isTransaction = false)
            : base(context, isTransaction)
        {
            
        }

        public void RemoveDataById(int id)
        {
            ServiceImage serviceImage = _context.ServiceImages.FirstOrDefault(a => a.Id == id );
            if(serviceImage!=null){
                _context.ServiceImages.Remove(serviceImage);
            }
            _context.SaveChanges();
        }
    }
}
